<?php 
namespace Home\Controller;
use Think\Controller;
/*
	测试登录地址
*/
class LoginmobileController extends Controller {
	
	//登录账号
	public function login_mobile(){
		$mobile_login = C('mobile_login');
		if($mobile_login['login']){
			$result = M('UserWxInfo')->where('uid = %d',$mobile_login['uid'])->find();
			if($result['id']){
					//把授权的openid加密
				$encrypt = wgw_encrypt($result['id'],'E','accredit');
				setcookie("wx_password",$encrypt,time()+9777600,'/');
				header("location:".U('Index/index'));die;
			}else{
				echo 'orz.......非法操作';die;
				
			}
		}
		
	}
	
}
